cogl_pc = 'mutter-cogl-' + mutter_api_version
cogl_pango_pc = 'mutter-cogl-pango-' + mutter_api_version
libmutter_pc = 'libmutter-' + mutter_api_version
+libmutter_test_pc = 'libmutter-test-' + mutter_api_version
ecal_req = '>= 3.33.1'
eds_req = '>= 3.33.1'
cogl_dep = dependency(cogl_pc, version: mutter_req)
cogl_pango_dep = dependency(cogl_pango_pc, version: mutter_req)
mutter_dep = dependency(libmutter_pc, version: mutter_req)
+mutter_test_dep = dependency(libmutter_test_pc, version: mutter_req)
polkit_dep = dependency('polkit-agent-1', version: polkit_req)
startup_dep = dependency('libstartup-notification-1.0', version: startup_req)
ibus_dep = dependency('ibus-1.0', version: ibus_req)
#include <gtk/gtk.h>
#include <glib/gi18n-lib.h>
#include <girepository.h>
-#include <meta/main.h>
+#include <meta/meta-context.h>
#include <meta/meta-plugin.h>
#include <meta/prefs.h>
#include <atk-bridge.h>
int
main (int argc, char **argv)
{
- GOptionContext *ctx;
+ g_autoptr (MetaContext) context = NULL;
GError *error = NULL;
- int ecode;
+ int ecode = EXIT_SUCCESS;
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
+ context = meta_create_context (WM_NAME);
+ meta_context_add_option_entries (context, gnome_shell_options,
+ GETTEXT_PACKAGE);
+ meta_context_add_option_group (context, g_irepository_get_option_group ());
+
session_mode = (char *) g_getenv ("GNOME_SHELL_SESSION_MODE");
- ctx = meta_get_option_context ();
- g_option_context_add_main_entries (ctx, gnome_shell_options, GETTEXT_PACKAGE);
- g_option_context_add_group (ctx, g_irepository_get_option_group ());
- if (!g_option_context_parse (ctx, &argc, &argv, &error))
+ if (!meta_context_configure (context, &argc, &argv, &error))
{
- g_printerr ("%s: %s\n", argv[0], error->message);
- exit (1);
+ g_printerr ("Failed to configure: %s", error->message);
+ return EXIT_FAILURE;
}
- g_option_context_free (ctx);
-
- meta_plugin_manager_set_plugin_type (gnome_shell_plugin_get_type ());
-
- meta_set_wm_name (WM_NAME);
- meta_set_gnome_wm_keybindings (GNOME_WM_KEYBINDINGS);
+ meta_context_set_plugin_gtype (context, gnome_shell_plugin_get_type ());
+ meta_context_set_gnome_wm_keybindings (context, GNOME_WM_KEYBINDINGS);
- meta_init ();
+ if (!meta_context_setup (context, &error))
+ {
+ g_printerr ("Failed to setup: %s", error->message);
+ return EXIT_FAILURE;
+ }
/* FIXME: Add gjs API to set this stuff and don't depend on the
* environment. These propagate to child processes.
shell_init_debug (g_getenv ("SHELL_DEBUG"));
- shell_dbus_init (meta_get_replace_current_wm ());
+ shell_dbus_init (meta_context_is_replacing (context));
shell_a11y_init ();
shell_perf_log_init ();
shell_introspection_init ();
}
shell_profiler_init ();
- ecode = meta_run ();
+
+ if (!meta_context_start (context, &error))
+ {
+ g_printerr ("GNOME Shell failed to start: %s", error->message);
+ return EXIT_FAILURE;
+ }
+
+ if (!meta_context_run_main_loop (context, &error))
+ {
+ g_printerr ("GNOME Shell terminated with an error: %s", error->message);
+ ecode = EXIT_FAILURE;
+ }
+
+ meta_context_destroy (g_steal_pointer (&context));
+
shell_profiler_shutdown ();
g_debug ("Doing final cleanup");
#include "st-button.h"
#include <math.h>
#include <string.h>
-#include <meta/main.h>
+#include <meta-test/meta-context-test.h>
#include <meta/meta-backend.h>
static ClutterActor *stage;
int
main (int argc, char **argv)
{
+ MetaContext *context;
+ g_autoptr (GError) error = NULL;
MetaBackend *backend;
StTheme *theme;
StThemeContext *theme_context;
/* meta_init() cds to $HOME */
cwd = g_get_current_dir ();
- meta_test_init ();
+ context = meta_create_test_context (META_CONTEXT_TEST_TYPE_NESTED,
+ META_CONTEXT_TEST_FLAG_NONE);
+ if (!meta_context_configure (context, &argc, &argv, &error))
+ g_error ("Failed to configure: %s", error->message);
+
+ if (!meta_context_setup (context, &error))
+ g_error ("Failed to setup: %s", error->message);
if (chdir (cwd) < 0)
g_error ("chdir('%s') failed: %s", cwd, g_strerror (errno));
g_object_unref (text4);
g_object_unref (theme);
- clutter_actor_destroy (stage);
+ g_object_unref (context);
return fail ? 1 : 0;
}